<!-- views/Page.vue -->
<template>
  <div class="page-container">
    <h1>页面 {{ id }}</h1>
    <p>这是页面 {{ id }} 的内容</p>
    <button @click="goBack">返回首页</button>
  </div>
</template>

<script setup>
import { useRoute, useRouter } from 'vue-router';

const route = useRoute();
const router = useRouter();
const id = route.params.id;

const goBack = () => {
  router.push({ name: 'Home' });
};
</script>

<style scoped>
.page-container {
  padding: 20px;
  text-align: center;
}
</style>